<?php

namespace app\apiadmin\service\redis;

use Predis\Client;

class ImLogService extends RedisService
{
    private $redis;
    
    //创建字符串缓存
    public static function setString($key, $value, $expire = 0)
    {
        $msg = new static();
        return $msg->createString($key, $value, $expire);
    }
    
    //非静态-创建字符串缓存
    public function createString($key, $value, $expire = 0)
    {
        $r = $this->redis->set($key, $value);
        if ($expire > 0) {
            $this->redis->expire($key, $expire);
        }
        return $r;
    }
    
    
}